Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading GRPC version to 1.33, Netty to 4.1.50Final and ETCD client driver #2582

Merged
merged 10 commits into from Feb 9, 2021

Conversation

dlg99
Copy link
Contributor

@dlg99 dlg99 commented Feb 3, 2021

Descriptions of the changes in this PR:

upgraded GRPC
Will need to upgrade GRPC in pulsar as well

Upgrading:

  • GRPC version to 1.33
  • Netty to 4.1.50Final
  • ETCD client driver
  • TestContainers

Motivation

TableService stopped working under load.
jstack points to a problem with GRPC that is fixed in later versions

Changes

upgraded GRPC

Master Issue: #2581


In order to uphold a high standard for quality for code contributions, Apache BookKeeper runs various precommit
checks for pull requests. A pull request can only be merged when it passes precommit checks.


Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

If this PR is a BookKeeper Proposal (BP):

  • Make sure the PR title is formatted like:
    <BP-#>: Description of bookkeeper proposal
    e.g. BP-1: 64 bits ledger is support
  • Attach the master issue link in the description of this PR.
  • Attach the google doc link if the BP is written in Google Doc.

Otherwise:

  • Make sure the PR title is formatted like:
    <Issue #>: Description of pull request
    e.g. Issue 123: Description ...
  • Make sure tests pass via mvn clean apache-rat:check install spotbugs:check.
  • Replace <Issue #> in the title with the actual Issue number.

Copy link
Contributor

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

but unfortunately Integration tests of the Etcd metadata driver are failing```

Errors:
Error: org.apache.bookkeeper.metadata.etcd.Etcd64bitIdGeneratorTest.testGenerateIdParallel
Error: Run 1: Etcd64bitIdGeneratorTest.setUp:57->EtcdTestBase.setUp:79->EtcdTestBase.newEtcdClient:61 » NoSuchMethod
Error: Run 2: Etcd64bitIdGeneratorTest.setUp:57->EtcdTestBase.setUp:79->EtcdTestBase.newEtcdClient:61 » NoSuchMethod
Error: Run 3: Etcd64bitIdGeneratorTest.setUp:57->EtcdTestBase.setUp:79->EtcdTestBase.newEtcdClient:61 » NoSuchMethod
[INFO]

pom.xml Show resolved Hide resolved
pom.xml Outdated
@@ -130,7 +130,8 @@
<freebuilder.version>1.14.9</freebuilder.version>
<google.code.version>3.0.2</google.code.version>
<google.errorprone.version>2.1.2</google.errorprone.version>
<grpc.version>1.18.0</grpc.version>
<grpc.version>1.35.0</grpc.version>
<tomcat-annotations.version>1.35.0</tomcat-annotations.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that the tomcat-annotations.version is not correct. What is the exact reason for introducing this dependency?
It looks like the dependency isn't maintained, updated last in 2017: https://search.maven.org/artifact/org.apache.tomcat/annotations-api

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is resolved.

@dlg99
Copy link
Contributor Author

dlg99 commented Feb 4, 2021

The problem with the integration tests seems to be related to the etcd client.
We use com.coreos:jetcd-core 0.0.2 currently, it is 2 years old and unmaintained. It relies on the API that no longer exists in newer grpc
The new etcd client is io.etcd:jetcd-core 0.5.4; all imports and some APIs seem to have change as well; I'll try to update etcd client as well.

I am not sure what/whom this can affect but anyone running 2yo etcd should consider rethinking their life choices. :/

@dlg99
Copy link
Contributor Author

dlg99 commented Feb 8, 2021

So far:
I had to upgrade etcd client, which dragged testcontainers (and docker-java) upgrade as well.
All tests pass now.

I left netty at its current version. jetcd dependencies use newer version but TLS tests timeout with it
I see that netty had this change netty/netty#10407 in 4.1.52 that got reverted netty/netty#10980 in 4.1.59 (today's release, not even on maven central yet) - I suspect this is the reason for the test timeout. As long as etcd test pass I assume it is ok with older version.

A few notes:
Most of the API changes (deprecated => current) are rather mechanical.
EtcdBookieRegister deserves closer look.
I left deprecated grpc API in couple of places (i.e. BKRegistrationNameResolverProvider) because one experimental API (ManagedChannelBuilder.nameResolverFactory) is deprecated in favor of another experimental API (NameResolverRegistry) and introducing larger changes didn't make sense if that experimental change can get deprecated soon anyways.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.
I will check tomorrow the hardest parts.

Aren't we updating LICENSE files?

@dlg99
Copy link
Contributor Author

dlg99 commented Feb 9, 2021

@eolivelli The licenses weren't updated in a while. I.e. licenses still referred netty 4.1.32, the build is on 4.1.50, similarly others (rocksdb etc).
I did first pass on updating the licenses for the server, haven't touched two other tars.
TBH at this point I am thinking that the best way to deal with this is:

  • undo last commit (licenses change) in this PR
  • create separate issue/PR specifically for the licenses update; make it a blocker for the release, if needed. Deal with licenses there.
  • add licenses validation into the PR validation

This is what's currently left for the server, after the last commit:

$ dev/check-binary-license bookkeeper-dist/server/target/bookkeeper-server-4.13.0-SNAPSHOT-bin.tar.gz 

com.google.android-annotations-4.1.1.4.jar unaccounted for in LICENSE
com.google.auto.value-auto-value-annotations-1.7.jar unaccounted for in LICENSE
com.google.code.gson-gson-2.8.6.jar unaccounted for in LICENSE
com.google.guava-failureaccess-1.0.1.jar unaccounted for in LICENSE
com.google.guava-guava-30.0-jre.jar unaccounted for in LICENSE
com.google.guava-listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar unaccounted for in LICENSE
com.google.http-client-google-http-client-1.34.0.jar unaccounted for in LICENSE
com.google.http-client-google-http-client-jackson2-1.34.0.jar unaccounted for in LICENSE
com.google.j2objc-j2objc-annotations-1.3.jar unaccounted for in LICENSE
com.google.protobuf-protobuf-java-util-3.12.0.jar unaccounted for in LICENSE
com.google.re2j-re2j-1.2.jar unaccounted for in LICENSE
com.squareup.okhttp-okhttp-2.7.4.jar unaccounted for in LICENSE
io.dropwizard.metrics-metrics-core-3.1.0.jar unaccounted for in LICENSE
io.perfmark-perfmark-api-0.19.0.jar unaccounted for in LICENSE
org.apache.thrift-libthrift-0.12.0.jar unaccounted for in LICENSE
org.checkerframework-checker-qual-3.5.0.jar unaccounted for in LICENSE
org.conscrypt-conscrypt-openjdk-uber-2.5.1.jar unaccounted for in LICENSE
org.rocksdb-rocksdbjni-6.10.2.jar unaccounted for in LICENSE
org.xerial.snappy-snappy-java-1.1.7.jar unaccounted for in LICENSE
com.google.guava-guava-30.0.jar mentioned in LICENSE, but not bundled
org.rocksdb-rocksdbjni-5.13.1.jar mentioned in LICENSE, but not bundled
com.google.code.gson-gson-2.7.jar mentioned in LICENSE, but not bundled
com.squareup.okhttp-okhttp-2.5.0.jar mentioned in LICENSE, but not bundled
org.apache.thrift-libthrift-0.9.3.jar mentioned in LICENSE, but not bundled
org.rocksdb-rocksdbjni-5.13.1.jar mentioned in LICENSE, but not bundled
com.google.protobuf.nano-protobuf-javanano-3.0.0-alpha-5.jar mentioned in LICENSE, but not bundled
jline-jline-2.11.jar mentioned in LICENSE, but not bundled
org.checkerframework-checker-compat-qual-2.5.2.jar mentioned in LICENSE, but not bundled
io.netty-netty-tcnative-boringssl-static-2.0.20.Final.jar mentioned in NOTICE, but not bundled
io.grpc-grpc-protobuf-nano-1.33.0.jar mentioned in NOTICE, but not bundled
deps/protobuf-3.14.0/LICENSE linked from LICENSE, but not found in tarball
deps/javax.servlet-api-4.0.0/CDDL+GPL-1.1 linked from LICENSE, but not found in tarball
deps/protobuf-3.5.1/LICENSE bundled, but not linked from LICENSE
deps/javax.servlet-api-3.1.0/CDDL+GPL-1.1 bundled, but not linked from LICENSE

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is <scope>test</scope> removed from testcontainers dependency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved by 2d86dc7

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed one question about dependencies in metadata-drivers/etcd/pom.xml. The <scope>test</scope> was removed for testcontainers dependency. However it seems odd that the same file contains other test dependencies such as

    <dependency>
      <groupId>org.arquillian.cube</groupId>
      <artifactId>arquillian-cube-docker</artifactId>
      <version>${arquillian-cube.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.github.docker-java</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-standalone</artifactId>
      <version>${arquillian-junit.version}</version>
      <exclusions>
        <exclusion>
          <groupId>com.github.docker-java</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

Is this intentional?

<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-docker</artifactId>
<version>${arquillian-cube.version}</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have <scope>test</scope> ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved by 2d86dc7

<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-standalone</artifactId>
<version>${arquillian-junit.version}</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have <scope>test</scope> ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved by 2d86dc7

@eolivelli
Copy link
Contributor

@dlg99 I have added a commit in order to address @lhotari comment

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eolivelli eolivelli changed the title Upgrading GRPC version Upgrading GRPC version, Netty to 4.1.50Final and ETCD client driver Feb 9, 2021
@eolivelli eolivelli changed the title Upgrading GRPC version, Netty to 4.1.50Final and ETCD client driver Upgrading GRPC version to 1.33, Netty to 4.1.50Final and ETCD client driver Feb 9, 2021
@eolivelli eolivelli added this to the 4.13.0 milestone Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants